package masterjava.common.exception;

import masterjava.common.type.FaultInfoType;

import java.rmi.RemoteException;

/**
 * MasterJava.ru
 * <p/>
 * Client is unavailable at the moment and can be initialized afterwards
 *
 * User: GKislin
 * Date: 01.03.11
 */
public class ClientUnavailableException extends RemoteException implements FaultInfo {
    private final String clientName;

    public ClientUnavailableException(String clientName, String msg) {
        super(msg);
        this.clientName = clientName;
    }

    public String getClientName() {
        return clientName;
    }

    @Override
    public FaultInfoType getFaultInfo() {
        FaultInfoType info = CommonExceptionType.CLIENT_UNAVAILABLE.getFaultInfo();
        info.setDetail(toString());
        return info;
    }
}
